package oj;

import java.util.Scanner;

public class Test2 {
    public static boolean isLegal(char ch){//判断字符是否合法
        if(ch >= '0' && ch <= '9' || ch >= 'a' && ch <='z'){
            return true;
        }
        return false;
    }
    public static boolean func1(String s){
        int left = 0;
        int right = s.length() - 1;
        while(left < right){
            while (left < right && isLegal(s.charAt(left)) == false){//注意：需要再次判断left是否仍然小于right
                left++;
            }
            while (left < right && isLegal(s.charAt(right)) == false){
                right--;
            }
            if(s.charAt(left) == s.charAt(right)){
                left++;
                right--;
            }else {
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String s1 =  s.toLowerCase();
        System.out.println(func1(s1));
    }
}
